<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 *
 * @package		Adminpro
 * @author		Tran Hoang Thien (thienhb12@gmail.com)
 * @copyright   PHP TEAM
 * @link		http://phpandmysql.net
 * @since		Version 1.0
 * @phone       0944418192
 *
 */
class Episode_model extends MY_Model {
	public $table = 'ep';
	public $key   = 'epid';
	
	public function __construct(){
		parent:: __construct();
	}

	public function save($id=false,$data=array()){
    	if(!$id){
    		return $this->insert($data);
    	}
    	$result = $this->update($id,$data);
    	if($result){
    		return $id;
    	}
    	return false;
    } 

    public function count_all_ep($id_film = ''){
        if($id_film != NULL){
            $this->db->where('idphim',$id_film);
            return $this->count_all();
        }else{
            return FALSE;
        }
    }
}

/* End of file role_model.php */
/* Location: ./application/modules/admin/models/role_model.php */